<template>
	<view class="">
		
	</view>
</template>

<script>
	import { accountOrder } from "@/api/public.js"
	export default {
		data(){
			return {
				id: "",
			}
		},
		onLoad(obj){
			console.log(obj, "传参")
			this.id = obj.id
			let arr = [{"goods_id": obj.id, "goods_num": 1, "goods_type": 2}];
			let str = JSON.stringify(arr);
			accountOrder(str).then(res=>{
				if(res.result == 0){
					uni.setStorageSync("accountsType", 1);
					uni.reLaunch({
						url: "../shoppingCart/confirmOrder?goods=" + str + "&orderType=2"
					})
				}else{
					uni.navigateBack()
				}
			})
		},
	}
</script>

<style>
</style>
